package cn.stylefeng.guns.modular.api;

import cn.stylefeng.guns.modular.business.service.PageContentService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/gunsApi/pageContent")
public class PageContentApi extends BaseController {

    @Autowired
    private PageContentService pageContentService;


    @ApiOperation("根据code获取单页内容")
    @GetMapping("/content")
    public ResponseData getPageContentByCode(@RequestParam String code) {
        return ResponseData.success(pageContentService.getPageContentByCode(code));
    }
}


